Skip to content

feat(studio): MetricTrendPanel - #1269

Merged
steramae-nvidia merged 2 commits into
mainfrom
steramae/metric-trend-panel
Aug 14, 2026
Merged

feat(studio): MetricTrendPanel#1269
steramae-nvidia merged 2 commits into
mainfrom
steramae/metric-trend-panel

Conversation

@steramae-nvidia

@steramae-nvidia steramae-nvidia commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
Screenshot 2026-08-14 at 10 57 13 AM Screenshot 2026-08-14 at 10 57 07 AM Screenshot 2026-08-14 at 10 57 01 AM Screenshot 2026-08-14 at 10 56 56 AM

Signed-off-by: Sean Teramae steramae@nvidia.com

Summary

Related Issue

Changes

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with documentation updates
  • Documentation only
  • Contributor tooling or automation
  • CI, build, or test infrastructure

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Documentation updated for user-visible behavior
  • Documentation not applicable — justification:

Verification

  • Pull request title follows the repository's Conventional Commit format
  • Every commit includes an appropriate Signed-off-by: trailer
  • uv run pre-commit run -a passes, or any blocked checks are identified below
  • Targeted tests pass, or tests are marked not applicable above
  • No secrets, API keys, or credentials are included

Targeted validation:

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Added a metric trend panel for visualizing time-based data with responsive charts and tooltips.
    • Supports multiple metric series, easy series switching, comparison values, delta indicators, and customizable formatting.
    • Added loading-state placeholders and an optional header action for viewing more details.
    • Includes light and dark theme styling for a consistent experience across the application.

@steramae-nvidia

Copy link
Copy Markdown
Contributor Author

This change is part of the following stack:

Change managed by git-spice.

@steramae-nvidia
steramae-nvidia requested review from a team as code owners August 12, 2026 23:05
@github-actions github-actions Bot added the feat label Aug 12, 2026
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7c080d29-3992-478b-b5e9-239474b9fed9

📥 Commits

Reviewing files that changed from the base of the PR and between ac39af0 and feaf52f.

📒 Files selected for processing (3)
  • web/packages/studio/src/components/charts/MetricTrendPanel/MetricTrendPanel.stories.tsx
  • web/packages/studio/src/components/charts/MetricTrendPanel/MetricTrendPanel.test.tsx
  • web/packages/studio/src/components/charts/MetricTrendPanel/index.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • web/packages/studio/src/components/charts/MetricTrendPanel/MetricTrendPanel.test.tsx
  • web/packages/studio/src/components/charts/MetricTrendPanel/index.tsx

📝 Walkthrough

Walkthrough

Adds MetricTrendPanel with typed metric series, selectable trends, formatted values, deltas, loading and empty states, themed charts, optional view actions, Storybook scenarios, and interaction tests.

Changes

Metric Trend Panel

Layer / File(s) Summary
Panel contracts and rendering
web/packages/studio/src/components/charts/MetricTrendPanel/index.tsx
Defines metric data and panel props. Renders selectable series, formatted values, deltas, callbacks, loading and empty states, and a responsive themed area chart.
Storybook scenarios
web/packages/studio/src/components/charts/MetricTrendPanel/MetricTrendPanel.stories.tsx
Adds deterministic chart data and stories for default, single-series, negative-delta, zero-delta, value-caption, and loading states.
Interaction validation
web/packages/studio/src/components/charts/MetricTrendPanel/MetricTrendPanel.test.tsx
Tests default display, uncontrolled and controlled series selection, callbacks, zero-delta styling, and empty-state rendering.

Suggested reviewers: a2bondar

Sequence Diagram(s)

sequenceDiagram
  participant Consumer
  participant MetricTrendPanel
  participant Recharts
  Consumer->>MetricTrendPanel: Provide metric series and panel props
  MetricTrendPanel->>Recharts: Render active-series trend data
  Recharts-->>MetricTrendPanel: Render responsive area chart
  MetricTrendPanel-->>Consumer: Render values, delta, series controls, and view action
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the new MetricTrendPanel feature, which is the main change in the pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch steramae/metric-trend-panel

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
web/packages/studio/src/components/charts/MetricTrendPanel/index.tsx (1)

17-17: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Import FC as a type.

FC is used only as a type.

-import { FC, useId, useMemo, useState } from 'react';
+import { useId, useMemo, useState } from 'react';
+import type { FC } from 'react';

As per coding guidelines, “Use import type for type-only imports.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/packages/studio/src/components/charts/MetricTrendPanel/index.tsx` at line
17, Update the React import in MetricTrendPanel to import FC using a type-only
import while keeping useId, useMemo, and useState as runtime imports.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/packages/studio/src/components/charts/MetricTrendPanel/index.tsx`:
- Around line 101-140: Update the delta styling and rendering in
MetricTrendPanel so delta === 0 uses the neutral tag color and omits the
Triangle, while preserving the existing red/downward behavior for negative
values and green/upward behavior for positive values. Add a test covering zero
delta and asserting the neutral presentation without a directional icon.
- Around line 172-175: Update the loading condition in MetricTrendPanel so an
empty series with isPending=false does not render StackedSkeleton indefinitely;
render the established empty state instead, or enforce a non-empty series
contract. Add a test covering series={[]} with isPending={false} and verify the
loading skeleton is not shown.

---

Nitpick comments:
In `@web/packages/studio/src/components/charts/MetricTrendPanel/index.tsx`:
- Line 17: Update the React import in MetricTrendPanel to import FC using a
type-only import while keeping useId, useMemo, and useState as runtime imports.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: abb58632-2b8c-4b9b-ad33-3b77fb751498

📥 Commits

Reviewing files that changed from the base of the PR and between 5f6569d and 6bca085.

📒 Files selected for processing (3)
  • web/packages/studio/src/components/charts/MetricTrendPanel/MetricTrendPanel.stories.tsx
  • web/packages/studio/src/components/charts/MetricTrendPanel/MetricTrendPanel.test.tsx
  • web/packages/studio/src/components/charts/MetricTrendPanel/index.tsx

Comment thread web/packages/studio/src/components/charts/MetricTrendPanel/index.tsx Outdated
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 33361/42124 79.2% 64.1%
Integration Tests 19481/39923 48.8% 21.1%

@rrhyne

rrhyne commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

This requires quite a bit of additional vertical space. Can we render the values to the left and the buttons and chart on the right as per the design?

image

Signed-off-by: Sean Teramae <steramae@nvidia.com>
@steramae-nvidia
steramae-nvidia force-pushed the steramae/metric-trend-panel branch from 6bca085 to ac39af0 Compare August 14, 2026 16:53
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

Signed-off-by: Sean Teramae <steramae@nvidia.com>
@steramae-nvidia
steramae-nvidia added this pull request to the merge queue Aug 14, 2026
Merged via the queue into main with commit 78d7b0a Aug 14, 2026
63 of 106 checks passed
@steramae-nvidia
steramae-nvidia deleted the steramae/metric-trend-panel branch August 14, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants